package com.jiaobeng;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * @author leonard
 * @Description
 * @date 2021-04-30 10:15
 */
public class bb {

    private static final String src = "E:\\java_idea\\lingJinCode\\basic-core-java\\src\\main\\resources\\json2";


    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new FileReader(src));
        String json="";
        String str = "";
        while((str=reader.readLine())!=null){
            json = json + str +"\n";
        }
        //System.out.println(json);
        JSONObject jsonObject= JSONObject.parseObject(json);
        Map result = JSON.parseObject(jsonObject.toJSONString(), new TypeReference<Map>() {});
        List<Map> aa = (List<Map>) result.get("data");
        for(int index = 0;index<aa.size();index++){
            String aaaaa = (String)aa.get(index).get("email");
            System.out.println(aaaaa);
        }
        reader.close();
    }

}
